# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1293149235.708851
_template_filename='/home/sunzheng/Projects/FidoWeb/FidoWeb_0.98/fidoweb/templates/global/globalheader.mako'
_template_uri='global/globalheader.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = []


def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        c = context.get('c', UNDEFINED)
        url = context.get('url', UNDEFINED)
        request = context.get('request', UNDEFINED)
        len = context.get('len', UNDEFINED)
        range = context.get('range', UNDEFINED)
        str = context.get('str', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1

        curSchoolId = 0
        tmpId = -1
        if request.cookies.has_key('global.school.id') : tmpId = request.cookies['global.school.id']
        for i in range(0, len(c.schools)) :
                s = c.schools[i]
                if tmpId == str(s.id) : curSchoolId = i
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['i','tmpId','curSchoolId','s'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 8
        __M_writer(u'\r\n<div class="global_header"><div id="global_header_mid">\r\n\t<script type="text/javascript">\r\n\t\t$(document).ready(function(){\r\n\t\t\tvar schoolMenu = $("#global_panel #school_menu");\r\n\t\t\tvar loginMenu = $("#global_panel #login_menu");\r\n\t\t\tvar notifyMenu = $("#global_panel #notification_menu");\r\n\t\t\t$("#global_panel #school").click(function(){\r\n\t\t\t\tschoolMenu.removeClass("menu");\r\n\t\t\t\tschoolMenu.addClass("menu_show");\r\n\t\t\t\tschoolMenu.css("left", $("#global_panel #school").width() - schoolMenu.width() + 8 + "px");\r\n\t\t\t\t$("#global_panel #school").removeClass("head_normal");\r\n\t\t\t\t$("#global_panel #school").addClass("head_activated");\r\n\t\t\t});\r\n\t\t\t$("#global_panel #login").click(function(){\r\n\t\t\t\tloginMenu.removeClass("menu");\r\n\t\t\t\tloginMenu.addClass("menu_show");\r\n\t\t\t\tloginMenu.css("left", $("#global_panel #login").width() - loginMenu.width() + 8 + "px");\r\n\t\t\t\t$("#global_panel #login").removeClass("head_normal");\r\n\t\t\t\t$("#global_panel #login").addClass("head_activated");\r\n\t\t\t});\r\n\t\t\t$("#global_panel #notification").click(function(){\r\n\t\t\t\tnotifyMenu.removeClass("menu");\r\n\t\t\t\tnotifyMenu.addClass("menu_show");\r\n\t\t\t\tnotifyMenu.css("left", $("#global_panel #notification").width() - notifyMenu.width() + 8 + "px");\r\n\t\t\t\t$("#global_panel #notification").removeClass("head_normal");\r\n\t\t\t\t$("#global_panel #notification").addClass("head_activated");\r\n\t\t\t});\r\n\t\t\t$(document).click(function(event){\r\n\t\t\t\tif (!$(event.target).closest("#global_panel #school_menu").size() && !$(event.target).closest("#global_panel #school").size()){\r\n\t\t\t\t\tschoolMenu.addClass("menu");\r\n\t\t\t\t\tschoolMenu.removeClass("menu_show");\r\n\t\t\t\t\t$("#global_panel #school").addClass("head_normal");\r\n\t\t\t\t\t$("#global_panel #school").removeClass("head_activated");\r\n\t\t\t\t}\r\n\t\t\t\tif (!$(event.target).closest("#global_panel #login_menu").size() && !$(event.target).closest("#global_panel #login").size()){\r\n\t\t\t\t\tloginMenu.addClass("menu");\r\n\t\t\t\t\tloginMenu.removeClass("menu_show");\r\n\t\t\t\t\t$("#global_panel #login").addClass("head_normal");\r\n\t\t\t\t\t$("#global_panel #login").removeClass("head_activated");\r\n\t\t\t\t}\r\n\t\t\t\tif (!$(event.target).closest("#global_panel #notification_menu").size() && !$(event.target).closest("#global_panel #notification").size()){\r\n\t\t\t\t\tnotifyMenu.addClass("menu");\r\n\t\t\t\t\tnotifyMenu.removeClass("menu_show");\r\n\t\t\t\t\t$("#global_panel #notification").addClass("head_normal");\r\n\t\t\t\t\t$("#global_panel #notification").removeClass("head_activated");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t</script>\r\n\t<div id="fidologo"><a href="/map"></a></div>\r\n\t<div id="globalnav">\r\n')
        # SOURCE LINE 60
        if url.current()[ : 4] == '/map' or url.current()[ : 18] == '/dispatch.fcgi/map':
            # SOURCE LINE 61
            __M_writer(u'\t\t<li><a id="link_places_cur"></a></li>\r\n')
            # SOURCE LINE 62
        else :
            # SOURCE LINE 63
            __M_writer(u'\t\t<li><a id="link_places" href="/map"></a></li>\r\n')
            pass
        # SOURCE LINE 65
        if url.current()[ : 6] == '/login' or url.current()[ : 20] == '/dispatch.fcgi/login':
            # SOURCE LINE 66
            __M_writer(u'\t\t\t<li><a id="link_myfido_cur"></a></li>\r\n')
            # SOURCE LINE 67
        else :
            # SOURCE LINE 68
            __M_writer(u'\t\t\t<li><a id="link_myfido" href="/login"></a></li>\r\n')
            pass
        # SOURCE LINE 70
        __M_writer(u'\t</div>\r\n\t<div id="globalpanel">\r\n\t\t<div id="global_panel">\r\n\t\t\t<div style="float:left;position:relative;">\r\n\t\t\t\t<div id="school_menu" class="menu">\r\n\t\t\t\t\t<h2>\u8bf7\u9009\u62e9\u5b66\u6821...</h2>\r\n\t\t\t\t\t<div style="border-bottom:1px solid #CCCCCC;margin:3px 0;"></div>\r\n\t\t\t\t\t<ul>\r\n')
        # SOURCE LINE 78
        for s in c.schools :
            # SOURCE LINE 79
            __M_writer(u'\t\t\t\t\t\t\t<li><a href="javascript:globalCtrl.setCurSchool(')
            __M_writer(filters.decode.utf8(s.id))
            __M_writer(u');">')
            __M_writer(filters.decode.utf8(s.name))
            __M_writer(u'</a></li>\r\n')
            pass
        # SOURCE LINE 81
        __M_writer(u'\t\t\t\t\t</ul>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div id="school" class="head_normal">\r\n\t\t\t\t\t<span id="school_icon"></span>\r\n\t\t\t\t\t<span id="cur_school">')
        # SOURCE LINE 85
        __M_writer(filters.decode.utf8(c.schools[curSchoolId].name))
        __M_writer(u'</span>\r\n\t\t\t\t\t<span id="global_menu_dropdown"></span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n')
        # SOURCE LINE 89
        if c.loginUser != None :
            # SOURCE LINE 90
            __M_writer(u'\t\t\t\t<div style="float:left;position:relative;">\r\n\t\t\t\t\t<div id="notification_menu" class="menu">\r\n\t\t\t\t\t\t<h2>\u6d88\u606f</h2>\r\n\t\t\t\t\t\t<div style="border-bottom:1px solid #CCCCCC;margin:3px 0;"></div>\r\n\t\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t\t')
            # SOURCE LINE 95

            notifyCount = 0
                                                                    
            
            __M_locals_builtin_stored = __M_locals_builtin()
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['notifyCount'] if __M_key in __M_locals_builtin_stored]))
            # SOURCE LINE 97
            __M_writer(u'\r\n')
            # SOURCE LINE 98
            for n in c.loginUser.notifications :
                # SOURCE LINE 99
                __M_writer(u'\t\t\t\t\t\t\t\t')
                notifyCount += 1 
                
                __M_locals_builtin_stored = __M_locals_builtin()
                __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['notifyCount'] if __M_key in __M_locals_builtin_stored]))
                __M_writer(u'\r\n\t\t\t\t\t\t\t\t<li><div id="update_time">')
                # SOURCE LINE 100
                __M_writer(filters.decode.utf8(n.updateTime.strftime('%m-%d %H:%M')))
                __M_writer(u'</div><div id="content">')
                __M_writer(filters.decode.utf8(n.content))
                __M_writer(u'</div></li>\r\n')
                pass
            # SOURCE LINE 102
            if notifyCount == 0 : 
                # SOURCE LINE 103
                __M_writer(u'\t\t\t\t\t\t\t\t\u6682\u65e0\u65b0\u6d88\u606f\r\n')
                pass
            # SOURCE LINE 105
            __M_writer(u'\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id="notification" class="head_normal">\r\n\t\t\t\t\t\t<span id="head">\t\r\n\t\t\t\t\t\t\t<span id="notification_icon"></span>\r\n\t\t\t\t\t\t\t<span id="notification_count">')
            # SOURCE LINE 110
            __M_writer(filters.decode.utf8(notifyCount))
            __M_writer(u'\u6761\u6d88\u606f</span>\r\n\t\t\t\t\t\t\t<span id="global_menu_dropdown"></span>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div style="float:left;position:relative;">\r\n\t\t\t\t\t<div id="login_menu" class="menu">\r\n\t\t\t\t\t\t<div style="clear:both;"><a href="/login/index/settings">\u8bbe\u7f6e</a></div>\r\n\t\t\t\t\t\t<div style="clear:both;"><a href="javascript:globalCtrl.logout();">\u767b\u51fa</a></div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id="login" class="head_normal">\r\n\t\t\t\t\t\t<span id="head">\t\r\n\t\t\t\t\t\t\t<span id="user_icon"></span>\r\n\t\t\t\t\t\t\t<span id="global_menu_user_name">')
            # SOURCE LINE 123
            __M_writer(filters.decode.utf8(c.loginUser.name))
            __M_writer(u'</span>\r\n\t\t\t\t\t\t\t<span id="global_menu_dropdown"></span>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n')
            # SOURCE LINE 128
        else :
            # SOURCE LINE 129
            __M_writer(u'\t\t\t\t<div id="dv_login"><span id="login_icon"></span><a href="/login">\u767b\u5f55</a></div>\r\n\t\t\t\t<div id="dv_signup"><span id="signup_icon"></span><a href="/login/signup">\u6ce8\u518c</a></div>\r\n')
            pass
        # SOURCE LINE 132
        __M_writer(u'\t\t</div>\r\n</div></div>\r\n\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


